<?php

/**
 * This is the model class for table "tbl_resp_ges_ceros".
 *
 * The followings are the available columns in table 'tbl_resp_ges_ceros':
 * @property integer $rce_id
 * @property string $rce_codigo
 * @property string $rce_resp
 * @property string $rce_resp_modulos
 * @property string $rce_tipobol
 * @property string $rce_posgrid
 * @property string $rce_pregunta
 * @property string $rce_column
 * @property string $rce_nivel
 * @property string $rce_fecha
 * @property string $rce_usuarios
 * @property integer $rce_estado
 */
class tbl_resp_ges_ceros extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return tbl_resp_ges_ceros the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'tbl_resp_ges_ceros';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('rce_codigo, rce_resp, rce_resp_modulos, rce_tipobol, rce_pregunta, rce_nivel, rce_fecha, rce_usuarios, rce_estado', 'required'),
			array('rce_estado', 'numerical', 'integerOnly'=>true),
			array('rce_posgrid', 'length', 'max'=>10),
			array('rce_codigo', 'length', 'max'=>15),
			array('rce_resp, rce_pregunta', 'length', 'max'=>7),
			array('rce_resp_modulos', 'length', 'max'=>10),
			array('rce_tipobol', 'length', 'max'=>4),
			array('rce_column', 'length', 'max'=>150),
			array('rce_nivel', 'length', 'max'=>6),
			array('rce_usuarios', 'length', 'max'=>5),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('rce_id, rce_codigo, rce_resp, rce_resp_modulos, rce_tipobol, rce_posgrid, rce_pregunta, rce_column, rce_nivel, rce_fecha, rce_usuarios, rce_estado', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'respMain'=>array(self::BELONGS_TO, 'tbl_resp', array('rce_resp'=>'rma_codigo'))
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'rce_id' => 'Rce',
			'rce_codigo' => 'Rce Codigo',
			'rce_resp' => 'Rce Resp',
			'rce_resp_modulos' => 'Rce Resp Modulos',
			'rce_tipobol' => 'Rce Tipobol',
			'rce_posgrid' => 'Rce Posgrid',
			'rce_pregunta' => 'Rce Pregunta',
			'rce_column' => 'Rce Column',
			'rce_nivel' => 'Rce Nivel',
			'rce_fecha' => 'Rce Fecha',
			'rce_usuarios' => 'Rce Usuarios',
			'rce_estado' => 'Rce Estado',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('rce_id',$this->rce_id);

		$criteria->compare('rce_codigo',$this->rce_codigo,true);

		$criteria->compare('rce_resp',$this->rce_resp,true);

		$criteria->compare('rce_resp_modulos',$this->rce_resp_modulos,true);

		$criteria->compare('rce_tipobol',$this->rce_tipobol,true);

		$criteria->compare('rce_posgrid',$this->rce_posgrid,true);

		$criteria->compare('rce_pregunta',$this->rce_pregunta,true);

		$criteria->compare('rce_column',$this->rce_column,true);

		$criteria->compare('rce_nivel',$this->rce_nivel,true);

		$criteria->compare('rce_fecha',$this->rce_fecha,true);

		$criteria->compare('rce_usuarios',$this->rce_usuarios,true);

		$criteria->compare('rce_estado',$this->rce_estado);

		return new CActiveDataProvider('tbl_resp_ges_ceros', array(
			'criteria'=>$criteria,
		));
	}
}